package org.example.controller;

import org.example.po.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/test")
public class TestController {

    @RequestMapping("/t1")
    public String t1(){
        return "test";
    }
    @RequestMapping("/t2")
    @ResponseBody
    public String test2(){
        return "aaa";
    }

    @RequestMapping("/user/{id}")
    @ResponseBody
    public User findUser(@PathVariable("id") Integer id){
        return new User(id,"test",null,"10086");
    }
}
